<?php
##############################################
#
#   菜单配置
# @ Time：2016-12-9 - 上午12:00:09
# @ Author ：JiangYongWei <1085562810@qq.com>
# @ Encoding ：UTF-8 language ：PHP
#
##############################################

namespace Admin\Model;

class LoginModel extends AdminBaseModel{
	/* 用户组表  */
	protected $tableName = 'admin_users';	
	
	public function __construct($tableName = ''){
		//初始化数据库对象
		if(!empty($tableName)){
			$this -> tableName = $tableName;
		}	
		parent::__construct($this -> tableName);
	}
	
	/**
	 * 获取登入用户信息
	 * @param array $data
	 * @return array
	 */
	public function getLoginAdminUser($data){
		return $this -> where("username = '{$data['username']}' and password = '{$data['password']}'
						and status = 2")
					 -> field('id, username') -> find();
	}
	
}